# Contributor: 
# Maintainer: 
pkgname=py-flask-sqlalchemy
pkgver=2.1
pkgrel=2
pkgdesc="SQLAlchemy integration for Flask"
url="http://flask.pocoo.org/"
arch="noarch"
license="MIT"
depends="py-flask py-sqlalchemy"
depends_dev=""
makedepends="python2-dev python3-dev py-setuptools"
install=""
subpackages="py2-flask-sqlalchemy:py2 py3-flask-sqlalchemy:py3"
source="https://files.pythonhosted.org/packages/source/F/Flask-SQLAlchemy/Flask-SQLAlchemy-$pkgver.tar.gz"

builddir="$srcdir"/Flask-SQLAlchemy-$pkgver

build() {
	cd "$_builddir"
	python2 setup.py build
	python3 setup.py build
}

package() {
	mkdir -p "$pkgdir"
}

_py() {
        local python="$1"
        pkgdesc="$pkgdesc ${python#python}"
        depends="$depends $python"
        install_if="$pkgname=$pkgver-r$pkgrel $python"

        cd "$builddir"
        $python setup.py install --prefix=/usr --root="$subpkgdir"
}

py2() {
	cd "$builddir"
	_py python2
}

py3() {
	cd "$builddir"
	_py python3
}

md5sums="dc15fe08b07b434d3d2c4063b4674b72  Flask-SQLAlchemy-2.1.tar.gz"
sha256sums="c5244de44cc85d2267115624d83faef3f9e8f088756788694f305a5d5ad137c5  Flask-SQLAlchemy-2.1.tar.gz"
sha512sums="023f3dd011a57768e921928dd3df791a54c64bb8a0cc1bb545dbb8e16dda263b730da74a0d400e5a057819830dd4cd014a642098a081c956a7ea8a2d37ec112a  Flask-SQLAlchemy-2.1.tar.gz"
